package cn.edu.scau.cmi.yanghaorui.client;

import java.util.Scanner;

import cn.edu.scau.cmi.yanghaorui.factory.BeefFactory;
import cn.edu.scau.cmi.yanghaorui.factory.ChickenFactory;
import cn.edu.scau.cmi.yanghaorui.factory.MeatFactorys;
import cn.edu.scau.cmi.yanghaorui.factory.PorkFactory;
import cn.edu.scau.cmi.yanghaorui.simpleFactoryMethod.domain.Meat;

public class FactoryClient {

	public static void main(String[] args) {
		    int stop=0;
		while(stop!=1) {
			System.out.println("Please select which kind of meat you want to eat: beef or pork or chicken???");
			System.out.println("input \"exit\" to stop");
			Scanner scanner = new Scanner(System.in);  
			String meatKind = scanner.next();  
			MeatFactorys meatFactory=null;
			switch(meatKind) {
			case "beef": meatFactory=new BeefFactory();break;
			case "pork": meatFactory=new PorkFactory();break;
			case "chicken": meatFactory=new ChickenFactory();break;
			case "exit": stop=1;break;
			default:System.out.println("sorry, your input is not correct");
			
			}
			if(meatFactory!=null) {
				Meat meat=meatFactory.getMeat();
				meat.cook();
			}
			//if(meatKind=="exit") {
				//break;
			//}
		}
		
	}

	}


